<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
	<title>Search Excursions</title>
</h:head>
<h:body>
<p:panel>
	<h:link outcome = "bookings" value = "Return To The Package!"/>
</p:panel>
    <h:form id="form3">
	
     <p:dataTable var="excursion" value="#{excursionSearch.excUser}" rowKey="#{excursion.id}" 
    			 paginator="true"  
             
                filteredValue="#{excursionSearch.filteredUser}" 
                id="excursionsTable"
                emptyMessage="There are NO Excursions"
                paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
				rowsPerPageTemplate="5,10,15"
				
				cellSeparator="true"
				resizableColumns="true">  

      	<p:column headerText="Type" sortBy="type" filterBy="type" id="type">  
            #{excursion.type}
        </p:column> 
        
        <p:column headerText="Description" sortBy="description" filterBy="description" id="description">  
            #{excursion.description}
        </p:column>  

      	<p:column headerText="Date" sortBy="date" filterBy="date" id="date">  
            #{excursion.date}
        </p:column>   

      	<p:column headerText="Start Time" sortBy="startTime" filterBy="startTime" id="startTime">  
            #{excursion.startTime}
        </p:column>

      	<p:column headerText="End Time" sortBy="endTime" filterBy="endTime" id="endTime">  
            #{excursion.endTime}
        </p:column>
        
        <p:column headerText="Price" sortBy="price" filterBy="price" id="price">  
            #{excursion.price}
        </p:column>


   		<p:column style="width:32px">  
             <p:commandButton update=":dlgForm3:excDetGrid" oncomplete="excDialog.show()"  
                     image="ui-icon ui-icon-search" style="width:32px"
                     > 
                 <f:setPropertyActionListener value="#{excursion}"  
                     target="#{excursionSearch.currentExcursion}" />  
                    
             </p:commandButton> 
         </p:column> 
         <p:column style="width:32px">
               <p:commandButton style="width:32px" 
               	onmouseover="Add To Package!" icon="ui-icon-disk" 
        		 action="#{excursionSearch.changeExcursion()}"  ajax="false" update=":form3:excursionsTable">
                  <f:setPropertyActionListener value="#{excursion}"  
     	            target="#{excursionSearch.currentExcursion}" />  
            </p:commandButton>
         </p:column>
        
        
   </p:dataTable>
 </h:form>
   
   
   <p:dialog id="excDialog" header="Details" widgetVar="excDialog" resizable="true"  
              width="600" height="340" dynamic="true" showEffect="exlpode" hideEffect="explode" closeOnEscape="true">  
        	 
          <h:form id="dlgForm3">
         <h:panelGrid id="excDetGrid" columns="2" >
         
         	          
					<h:outputLabel>Available*:</h:outputLabel>
					<p:selectBooleanCheckbox value="#{excursionSearch.currentExcursion.available}" disabled="true" />
					
				
					<h:outputLabel>Disponibility*:</h:outputLabel>
					<h:outputText value="#{excursionSearch.currentExcursion.disponibility}"/>
			
					<h:outputLabel>Price*:</h:outputLabel>
					<h:outputText value="#{excursionSearch.currentExcursion.price}"/>
			
					<h:outputLabel>Type*:</h:outputLabel>
					<h:outputText value="#{excursionSearch.currentExcursion.type}" />
			
					<h:outputLabel>Description*:</h:outputLabel>
					<h:outputText value="#{excursionSearch.currentExcursion.description}" rows="6" cols="33" />
			
					<h:outputLabel >Date*:</h:outputLabel>
					<p:calendar value="#{excursionSearch.currentExcursion.date}"  disabled="true"/>
		
					<h:outputLabel>Start Time*:</h:outputLabel>
					<p:calendar value="#{excursionSearch.currentExcursion.startTime}"  pattern="HH:mm" timeOnly="true" disabled="true"/>
		
					<h:outputLabel>End Time*:</h:outputLabel>
					<p:calendar value="#{excursionSearch.currentExcursion.endTime}"  pattern="HH:mm" timeOnly="true" disabled="true"/>
           

        </h:panelGrid> 
        
        </h:form>
        
		
        	
    </p:dialog>
    
    
       	
  
</h:body>

</html>